package com.app.qbake.module.mine;

import com.wind.base.adapter.BaseDelegateRecyclerAdapter;
import com.wind.base.mvp.view.BasePageFragment;
import com.wind.base.request.BaseRequest;
import com.wind.coder.annotations.Api;
import com.wind.coder.annotations.Heros;
import com.wind.coder.annotations.Param;
import com.wind.data.mine.FollowUserListRequest;
import com.wind.data.mine.FollowUserListResponse;
import com.app.qbake.R;
import com.app.qbake.module.mine.adapter.FollowUserAdapter;
import com.app.qbake.module.mine.di.FollowUserListComponent;
import com.app.qbake.module.mine.mvp.FollowUserListView;
import com.app.qbake.module.mine.presenter.FollowUserListPresenter;

import javax.inject.Inject;

@Heros(
        param = @Param(
                viewCanonicalName = "com.app.qbake.module.mine.mvp.FollowUserListView",
                responseCanonicalName = "com.wind.data.mine.FollowUserListResponse",
                requestCanonicalName = "com.wind.data.mine.FollowUserListRequest",
                page = true

        ),
        api = @Api(httpMethod = Api.HttpMethod.GET, url = "user/getFollow")
)
public class FollowUserListFragment extends BasePageFragment<FollowUserListView,FollowUserListPresenter,FollowUserListComponent,FollowUserListResponse>
implements FollowUserListView
{

        @Inject
        FollowUserListPresenter presenter;
        @Override
        public FollowUserListPresenter createPresenter() {
                return presenter;
        }

        @Override
        protected BaseDelegateRecyclerAdapter getAdapter() {
                FollowUserAdapter adapter=new FollowUserAdapter(getActivity());
                return adapter;
        }

        @Override
        protected BaseRequest buildRequest(boolean isFirstPage) {
                FollowUserListRequest request=new FollowUserListRequest();
                request.setFirstPage(isFirstPage);
                return request;
        }

        @Override
        protected int getLayoutRes() {
                return R.layout.fragment_list;
        }
}
